import service from "@/service";
//部位用量
export function usageStatisticsList(parameter) {
  let { secCode, equCode, startTime, projectName, placePart, page, pageSize } =
    parameter;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/sn-mp-data/usageStatisticsList?page=${page}&pageSize=${pageSize}`,
    method: "POST",
    data: {
      secCode,
      equCode,
      startTime,
      projectName,
      placePart,
    },
  });
}

//导出材料波动数据
export function exportMaterialTableData(parameter) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/sn-mp-data/downloadMaterialFluctuation`,
    method: "GET",
    apiType: "file",
    responseType: "arraybuffer",
    params: parameter,
  });
}

//材料波动列表数据
export function getMaterialTableData(parameter) {
  let {
    secCode,
    equCode,
    startTime,
    endTime,
    ratioName,
    page,
    pageSize,
    projectName,
    strengthGrade,
    placePart,
  } = parameter;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/sn-mp-data/materialFluctuationList?page=${page}&pageSize=${pageSize}`,
    method: "POST",
    data: {
      secCode,
      equCode,
      startTime,
      endTime,
      ratioName,
      projectName,
      strengthGrade,
      placePart,
    },
  });
}

//材料波动图表数据
export function getMaterialFluctuations(parameter) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/sn-mp-data/materialFluctuationChart`,
    method: "POST",
    data: parameter,
  });
}

//材料波动列表详情
export function getMaterialDetailsInfo(params) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/sn-mp-data/mpDataCarList`,
    method: "GET",
    params,
  });
}

//产能统计 查询有数据的日期列表
export function getHasDataDate(parameter) {
  let {
    equCode = "",
    secCode = "",
    ratioName = "",
    projectName = "",
    placePart = "",
    strengthGrade = "",
  } = parameter;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/sn-mp-data/queryDate?equCode=${equCode}&secCode=${secCode}&ratioName=${ratioName}&projectName=${projectName}&placePart=${placePart}&strengthGrade=${strengthGrade}`,
    method: "GET",
  });
}

//产能统计图表数据-按标段
export function getCapacityStatisticsSec(parameter) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/sn-mp-data/capacityStatisticsSecChart`,
    method: "POST",
    data: parameter,
  });
}

//产能统计图表数据-按拌和站
export function getCapacityStatisticsEqu(parameter) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/sn-mp-data/capacityStatisticsEquChart`,
    method: "POST",
    data: parameter,
  });
}

// 标号统计图表
export function capacityStatisticsStrengthGradeChart(parameter) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/sn-mp-data/capacityStatisticsStrengthGradeChart`,
    method: "POST",
    data: parameter,
  });
}

//材耗统计图表数据
export function getMaterialStatistical(parameter) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/sn-mp-data/materialStatistics`,
    method: "POST",
    data: parameter,
  });
}

//材耗统计导出
export function exportMaterialStatisticalTableData(parameter) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/sn-mp-data/downloadMaterialStatistics`,
    method: "GET",
    apiType: "file",
    responseType: "arraybuffer",
    params: parameter,
  });
}
